<template>
  <yk-space dir="vertical" style="width: 100%;" size="l">
    <TopTitle name="随笔随记" :is-search="true" style="margin-bottom: 8px;" @search="search" />
    <yk-space style="width: 100%;" size="l">
      <diaryComponent :newDiary="newDiary" :serchTerm="serchTerm" :pageSize="4"></diaryComponent>
      <diaryEditor style="flex: none; width: 600px;" @diaryData="diaryData"></diaryEditor>
    </yk-space>
  </yk-space>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import TopTitle from '@/components/bar/TopTitle.vue';
import diaryComponent from '@/components/diary/diaryComponent.vue';
import diaryEditor from '@/components/diary/diaryEditor.vue';
import type { DiaryData } from '@/utils/interface';


// 搜索
const serchTerm = ref()
const search = (e: string) => {
  serchTerm.value = e
}
// 接搜新建的日记
const newDiary = ref()
const diaryData = (e: DiaryData) => {
  // 这里可以处理新建的日记数据
  console.log('新建的日记数据:', e);
  newDiary.value = e;
};

</script>

<style scoped lang="less"></style>
